import 'package:flutter/material.dart';
import 'package:jd_shopping/services/ScreenAdaper.dart';
import 'package:jd_shopping/pages/Coustom/JdButton.dart';

class ReginSecond extends StatefulWidget {
  @override
  _ReginSecondState createState() => _ReginSecondState();
}

class _ReginSecondState extends State<ReginSecond> {
  @override
  Widget build(BuildContext context) {
    ScreenAdaper.init(context);

    Widget buildTextField() {
      return Container(
        padding: const EdgeInsets.all(1.0),
        alignment: Alignment.center,
        height: ScreenAdaper.height(80),
        decoration: new BoxDecoration(
          //color: Colors.grey,
          border: new Border.all(color: Colors.grey, width: 1.0),
          //borderRadius: new BorderRadius.circular(12.0)
        ),
        child: TextField(
          decoration: InputDecoration(
            hintText: '请输入验证码',
            contentPadding: const EdgeInsets.symmetric(vertical: 10.0),
          ),
          onTap: () {},
        ),
      );
    }

    return Scaffold(
      appBar: AppBar(title: Text('手机快速注册')),
      body: ListView(
        children: [
          SizedBox(height: ScreenAdaper.height(60)),
          Container(
            margin: EdgeInsets.fromLTRB(10, 0, 10, 0),
            child: Text(
              '请输入13229940480收到的验证码:',
              style: TextStyle(color: Colors.black, fontSize: 15),
            ),
          ),
          SizedBox(height: ScreenAdaper.height(20)),
          Container(
            margin: EdgeInsets.fromLTRB(10, 0, 10, 0),
            height: ScreenAdaper.height(80),
            child: Row(
              children: [
                Expanded(
                    flex: 2,
                    child: Container(
                      decoration: BoxDecoration(
                        border: Border.all(width: 1, color: Colors.grey),
                        color: Colors.white,
                      ),
                      child: TextField(
                        obscureText: false,
                        decoration: InputDecoration(
                            contentPadding:
                                const EdgeInsets.symmetric(vertical: 10.0),
                            hintText: '请输入验证码',
                            border: OutlineInputBorder(
                                borderSide: BorderSide.none)),
                        onChanged: (value) {
                          print(value);
                        },
                      ),
                    )),
                SizedBox(width: ScreenAdaper.height(10)),
                Expanded(
                  flex: 1,
                  child: Container(
                    height: ScreenAdaper.height(75),
                    child:  RaisedButton(
                    child: Text('重新发送'),
                    onPressed: () {},
                     ),
                    
                  )
                )
              ],
            ),
          ),
          SizedBox(height: ScreenAdaper.height(30)),
          JdButton(
            color: Colors.red,
            text: '下一步',
            cb: () {
              print('123');
              Navigator.pushNamed(context, '/regthree');
            },
          ),
          SizedBox(height: ScreenAdaper.height(30)),
          Container(
              margin: EdgeInsets.fromLTRB(10, 0, 10, 0),
              child: Row(
                children: <Widget>[
                  Text('遇到问题你可以'),
                  InkWell(
                    child: Text(
                      '联系客服',
                      style: TextStyle(
                        decoration: TextDecoration.underline,
                      ),
                    ),
                    onTap: () {
                      print('联系客服');
                    },
                  )
                ],
              ))
        ],
      ),
    );
  }
}
